import random

def quick_sort(arr):
    if len(arr) <= 1:
        return arr
    pivot = arr[len(arr) // 2]
    left = [x for x in arr if x < pivot]
    middle = [x for x in arr if x == pivot]
    right = [x for x in arr if x > pivot]
    return quick_sort(left) + middle + quick_sort(right)

# 生成1到100之间的10个随机数
random_numbers = [random.randint(1, 100) for _ in range(10)]
print("原始数组:", random_numbers)

# 对随机数组进行快速排序
sorted_numbers = quick_sort(random_numbers)
print("排序后的数组:", sorted_numbers)
